import { HTTP } from '../../utils/api.js';

class Index extends HTTP {
  constructor() { // 实例化构造函数
    super() // 实例化鸡肋
  }

  // 获取首页数据
  getIndeData(callback) {
    var that = this;
    var params = {
      url: that.getHistoryCarListUrl,
      method: 'GET',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  }

  // 根据车牌查询订单
  getFeeByCarData(meter, callback) {
    var that = this;
    var params = {
      url: that.getGetFeeByCarUrl + '?car=' + meter.car,
      method: 'GET',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  } 

  // 获取验证码
  getVerificationCodeData(meter, callback) {
    var that = this;
    var params = {
      url: that.getGetVerificationCodeUrl + meter,
      method: 'POST',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  }

  // 微信授权用户绑定手机号
  getValidateVerificationCodeData(meter, callback) {
    var that = this;
    var params = {
      url: that.getValidateVerificationCodeUrl + 'phoneNumber=' + meter.phone + '&code=' + meter.code,
      method: 'POST',
      success: function (data) {
        callback && callback(data)
      }
    }
    that.request(params);
  }


} 
export { Index }